import java.util.Scanner;

public class test12 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(); // 怪物个数
        int init = in.nextInt();//初始战力
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextInt();
        }
        System.out.println(getResult(init,nums));
    }
    public static int getResult(int init,int[] nums){
        // 战力不会为0
        for (int i = 0; i < nums.length; i++) {
            if(init>=nums[i])
                init+=nums[i];
            else
                init+=getRecursive(init,nums[i]);
        }
        return init;
    }

    public static int getRecursive(int a,int b){
        while (b!=0){
            int flag = b;
            b = a%b;
            a = flag;
        }
        return a;
    }
}
